With decreasing prices of memory and high-speed storage devices, central processing unit (CPU) performance has become as much of a bottleneck in database efficiency as input/output (I/O) performance. Traditional database systems must accommodate all variations and forms of data and thus traditional query execution models make many branching and iterative decisions when executing a query. Such an execution model results in each query being parsed and executed at run time by the database engine. Queries that would otherwise share similar code branches must nevertheless be parsed, planned, and executed anew each time.
Native compilation has been proposed to address the problems associated with a single parsing and execution pathway in a database engine. Code that is specific to a query may be generated at run time and executed by the database engine. Generation of computer code tailored to a query avoids parsing and executing queries in an iterative manner that requires many branching decisions.
Some compiler infrastructures, such as the low level virtual machine (LLVM) project, have proposed performing just-in-time (JIT) compilation of code specific to queries. Such infrastructures typically reduce queries to a low level programming language, or intermediate representation (IR), that is then transformed into machine code at runtime by a JIT compiler. JIT compilation can reduce the CPU processing power required when executing a query, as the database engine may execute code specific to the query instead of generalized code that is capable of responding to any query. However, JIT compilation introduces overhead, as significant CPU resources are required to generate and compile query-specific IR.